﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Forms;
using IrisGenerator.Framework.Messaging;

namespace IrisGenerator.Framework.Messaging
{
    public static class MessageToMessageBox
    {
        public static MessageResults Show(IrisGenerator.Framework.Messaging.Message message)
        {
            if (message != null)
            {
                MessageBoxButtons buttons = IrisGenerator.Framework.Messaging.Button.ConvertToMessageBoxButtons(message.Buttons);
                MessageBoxIcon icon=Icon.ConvertToMessageBoxIcon(message.Icon);
                MessageBoxDefaultButton defaultButton=DefaultButton.ConvertToMessageBoxDefaultButton(message.DefaultButton);
                return Result.ConvertFrom(MessageBox.Show(message.Content, message.Caption, buttons, icon, defaultButton));
            }
            return MessageResults.None;
        }
    }
}
